﻿using ScFramework.Core;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Pop : MonoBehaviour
{
    float time;
    private void OnEnable()
    {
        
        time = Time.time;
    }
    public bool destory = true;
    private void LateUpdate()
    {
        
        transform.localEulerAngles = Vector3.zero;
    }

    // Update is called once per frame
    void Update()
    {
        if (destory)
        {

        if (Time.time - time > 5|| InputManager.Instance.GetKeyDown(KeyCode.R))
        {
            ObjectPool.Recycle(this.gameObject);
        }
        }
    }
}
